Skip to content

Add GetCredentialName()#4428

Merged
antkmsft merged 17 commits intoAzure:mainfrom
antkmsft:tokencred-getname
Mar 14, 2023
Merged

Add GetCredentialName()#4428
antkmsft merged 17 commits intoAzure:mainfrom
antkmsft:tokencred-getname

Conversation

@antkmsft
Copy link
Member

@antkmsft antkmsft commented Mar 8, 2023

Closes #4418.

Note that this PR is not about getting rid of ChainedTokenCredential's special the private special constructor for DefaultAzureCredential - that will likely be taken care of in a separate subsequent PR, and would depend on what we decide for #4419. This PR has only 1 out of 2 changes needed to remove that constructor.

@antkmsft antkmsft marked this pull request as ready for review March 8, 2023 23:56
…onstructed name; Explicit tests for GetCredentialName()
Copy link
Member

@LarryOsterman LarryOsterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I'm not a fan of global functions which are scoped to a specific class implementation, I much prefer making class membership explicit and not scoping class specific methods to the source file implementing the class.

I'm also somewhat troubled by the number of places where you have credName as a parameter to individual credentials (specifically the ManagedIdentity related changes) - but I understand a desire to hide implementation details from customers.

@antkmsft antkmsft merged commit ef24dfd into Azure:main Mar 14, 2023
@antkmsft antkmsft deleted the tokencred-getname branch March 14, 2023 23:46
LarryOsterman added a commit that referenced this pull request Mar 30, 2023
* Add GetCredentialName() (#4428)

* Add GetCredentialName()

* Update

* Undo accidental change

* Clang-format

* Call GetCredentialName() instead of using constant; Return in-place constructed name; Explicit tests for GetCredentialName()

* PR feedback

* constructor parameter + non-virtual GetCredentialName()

* Update sdk/core/azure-core/CMakeLists.txt

* Update sdk/identity/azure-identity/test/ut/client_secret_credential_test.cpp

* Update sdk/identity/azure-identity/test/ut/client_certificate_credential_test.cpp

* GCC and Clang warnings

* Promote ThrowIfNotSafeCmdLineInput() to private member; avoid copies when calling GetCredentialName()

* Spelling

* Fix deprecated usage

* Fix iteration

* Clang-format

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 5702 (#4453)

* add healthinsights to Test-SampleMetadata script

* spacing

* update productSlug to azure-health-insights

---------

Co-authored-by: Asaf Levi <asaflevi@microsoft.com>

* Use aka.ms link to Identity troubleshooting (#4449)

* Use aka.ms link to Identity troubleshooting

* Update default_azure_credential.cpp

* Update default_azure_credential.cpp

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Undocument ChainedCred usage by DefaultAzCred & remove friend and private ctor (#4447)

* Undocument ChainedCred usage by DefaultAzCred & remove friend and private ctor

* Clang warning fix

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 5691 (#4450)

* typespec renaming

* add back scripts for cadl

* support .cadl and .tsp

* rename

* add newline at the end of file

---------

Co-authored-by: FAREAST\chunyu <chunyu@microsoft.com>

* fix cspell for readme.ms in libcurl sterss test (#4441)

* fix cspell

* capitalize Valgrind and ubuntu

* sdada

* fix2

* Simpler identity logging (#4455)

* Simpler identity logging

* Even simpler

* Remove refactoring artifact

* Cosmetic change

* foreach

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* 3rd Party Libs in Samples (#4408)

Adding guidance on the proper usage of 3rd Party Libraries in our samples.

* Update changelog with issue link (#4458)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Tests: replace most `EXPECT_TRUE(a OP b)` with `EXPECT_OP(a, b)` (#4457)

* Tests: replace most `EXPECT_TRUE(a OP b)` with `EXPECT_OP(a, b)`

* Undo unnecessary change

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Revert "[check-spelling] Temporarily pin Node 18 to 18.13.0 (#5537)" (#4456)

This reverts commit 8a02e02adfc0d213509fce2764132afa74bd4ba4.

Co-authored-by: Mike Harder <mharder@microsoft.com>

* Fix potentially high CPU usage on Windows (#4448)

* Fix potentially high CPU usage on Windows

* Undo unnecessary formatting

* Undo unnecessary changelog

* Undo unnecessary formatting

* Undo unnecessary formatting

* Uninclude locale

* Add issue link to changelog

* EXPECT_TRUE(a == b) => EXPECT_EQ(a, b)

* Update second changelog with link as well

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Ensure the comparison is unsigned to unsigned (#4464)

* Ensure the comparison is unsigned to unsigned

* Remove cast

* Sync eng/common directory with azure-sdk-tools for PR 5742 (#4465)

* add some default output to see about minimizing any occurrence of the task failing for no reason. perhaps having some output will allow devops to have an easier time with the invocation

* update message

* Update eng/common/scripts/trust-proxy-certificate.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update CODEOWNERS (#4461)

Fixup an invalid user

* Organize applying Identity log prefix (#4459)

* Organize applying Identity log prefix

* logLevel

* Cosmetic changes

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Explicitly set PSNativeCommandArgumentPassing to Legacy for git push script (#4481)

https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3#psnativecommandargumentpassing
Do to that breaking change in PS 7.3 we need to opt into the legacy arg parsing.

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>

* Fix unmatched parenthesis in doc (#4482)

* fix concurrent upload failures (#4484)

* Sync eng/common directory with azure-sdk-tools for PR 5726 (#4488)

* rerun flag

* rerun failed stress test

* naming & commenting

* update

* function and var renaming for better readability

* readability & exit on error

---------

Co-authored-by: Albert Cheng <albertcheng@microsoft.com>

---------

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Co-authored-by: Asaf Levi <asaflevi@microsoft.com>
Co-authored-by: FAREAST\chunyu <chunyu@microsoft.com>
Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com>
Co-authored-by: Ronnie Geraghty <ronniegerag@gmail.com>
Co-authored-by: Mike Harder <mharder@microsoft.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
Co-authored-by: JinmingHu <jinmhu@microsoft.com>
Co-authored-by: Albert Cheng <albertcheng@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we add Core::Credentials::TokenCredential::GetName()?

4 participants